package Homework;

import java.util.concurrent.ArrayBlockingQueue;

public class Cooker extends Thread {
    private ArrayBlockingQueue<String> abq;

    public Cooker(ArrayBlockingQueue<String> abq) {
        super();
        this.abq = abq;
    }

    @Override
    public void run() {
        while(true){
            try {
                Thread.sleep(100);
                for(int i=0;i<5;i++){
                    abq.put("汉堡包");
                }
                System.out.println("厨师放了5个汉堡包");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
